<?php
return array(
	'searchColumns' => array(
		'title',
		'provider_id' => array('dropDownList', Yii::app()->enum->options('worker.provider')),
	),
	'operates' => false,
	'dataColumns' => array(
		array(
			'name' => 'dealer.worker_name',
			'visible' => Yii::app()->adminUser->role != AdminUser::ROLE_DEALER,
		),
		array(
			'name' => 'provider.worker_name',
			'visible' => Yii::app()->adminUser->role != AdminUser::ROLE_PROVIDER,
		),
		'title',
		'price_market',
		'price_dealer',
		array(
			'name' => 'price_agent',
			'visible' => Yii::app()->adminUser->role != AdminUser::ROLE_DEALER,
		),
		array(
			'class' => 'ButtonColumn',
			'header' => '代理操作',
			'template' => '{agent}{deagent}{view}',
			'buttons' => array(
				'agent' => array(
					'label' => '代理',
					'url' => 'Yii::app()->controller->createUrl("agent", array("id"=>$data->id))',
					'visible' => '!$data->related_id',
				),
				'deagent' => array(
					'label' => '取消代理',
					'url' => 'Yii::app()->controller->createUrl("deagent", array("id"=>$data->id))',
					'visible' => '$data->related_id',
				),
				'view' => array(
					'label' => '查看',
					'url' => 'Yii::app()->controller->createUrl("goodsView/view", array("id"=>$data->goods_id))',
				)
			),
		),
	),
	'_import' => array(
		array('*', 'actions.admin//*'),
	),
);
?>